<template>
  <!-- <el-dropdown @command="test"  > -->
  <el-dropdown v-on="$listeners" v-bind="$attrs">
    <span class="el-dropdown-link">
      {{ title }}<i class="el-icon-arrow-down el-icon--right" />
    </span>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item
        v-for="(it, index) in items"
        :key="it.id || index"
        :command="it.key"
        :icon="it.icon"
      >
        {{ it.text }}
      </el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</template>

<script>
export default {
  name: "GDropDown",
  props: {
    title: String,
    items: Array,
  },
  // methods:{
  //     test(e){
  //         console.log("事件触发",e);
  //     }
  // }
};
</script>